﻿
Partial Class WebForm_Main_SearchServiceBulletin
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            RaiseEvent Loaded(Me, New EventArgs)
        End If
    End Sub

    Protected Sub gvBulletin_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvBulletin.PageIndexChanging
        Me.gvBulletin.PageIndex = e.NewPageIndex
        Me.BindGV()
    End Sub

    Protected Sub gvBulletin_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvBulletin.RowCommand
        If e.CommandName = "lknBulletinSubject" Then
            Dim row As GridViewRow = TryCast(TryCast(e.CommandSource, Control).NamingContainer, GridViewRow)
            Dim key As DataKey = Me.gvBulletin.DataKeys(row.RowIndex)

            Me.AddServiceBulletin1.Show(key("ServiceID"))
            'Me.upAddBulletin.Update()
        End If
    End Sub

    Protected Sub gvBulletin_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvBulletin.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
           
        End If
    End Sub
End Class

Partial Class WebForm_Main_SearchServiceBulletin
    Public Sub BindGV()


        Dim sql As New MyStringBuilder
        Dim dat As New clsData

        sql.AppendFormat("select s.* ")
        sql.AppendFormat("from ServiceBulletin s ")
        sql.AppendFormat("order by s.StartDate,s.EndDate")
        Me.gvBulletin.DataSource = dat.GetData(sql)
        Me.gvBulletin.DataBind()
    End Sub


    Public Event Loaded(ByVal source As Object, ByVal e As EventArgs)
End Class
